package com.fxu.jushuitan.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.PropertyNamingStrategy;
import com.alibaba.fastjson.serializer.SerializeConfig;

import java.util.List;

/**
 * 聚水潭接口调用工具类
 * @author fangxu
 * @since 2023-07-11
 */
public class JstBizUtil {
    // 变成业务文本
    public static String toListBiz(List<?> reqs) {
        SerializeConfig config = new SerializeConfig();
        config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
        return JSON.toJSONString(reqs, config);
    }
    // 变成业务文本
    public static String toBiz(Object req) {
        SerializeConfig config = new SerializeConfig();
        config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
        return JSON.toJSONString(req, config);
    }
}
